package br.edu.universo.si.projeto2.infojob.client.apresentacao;

import br.edu.universo.si.projeto2.infojob.client.util.Util;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;

public class ABannerCadastroProfissional extends DockPanel
{
	private DecoratorPanel decoratorPanel;
	private Image profissionalTechInfoImg;
	private Button cadastrarProfissionalBtn;

	private FlexTable flexTable;
	
	private Label tituloBannerProfissionalLbl;
	
	public ABannerCadastroProfissional()
	{
		decoratorPanel = new DecoratorPanel();
		profissionalTechInfoImg = new Image(Util.getImagensPath() + "professional_tech_info.JPG");
		cadastrarProfissionalBtn = new Button("Quero me cadastrar!");
		flexTable = new FlexTable();
		
		tituloBannerProfissionalLbl = new Label("Está procurando um novo emprego?!");
		tituloBannerProfissionalLbl.setStyleName("bannerTitulo");
		
		flexTable.setCellSpacing(10);
		FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter();

		flexTable.setWidget(0, 0, profissionalTechInfoImg);
		
		flexTable.setWidget(0, 1, tituloBannerProfissionalLbl);
		
		flexTable.setHTML(1, 0, "Você, profissional da área de T.I., cadastre-se agora mesmo " +
			"e tenha acesso as melhores vagas de T.I. oferecidas.");
		cellFormatter.setColSpan(1, 0, 2);
		
		// adiciona o botao na ultima linha, no centro
		flexTable.setWidget(2, 0, cadastrarProfissionalBtn);
		cellFormatter.setColSpan(2, 0, 2);
		cellFormatter.setAlignment(2, 0, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE);

		decoratorPanel.add(flexTable);
		
		this.add(decoratorPanel, DockPanel.CENTER);
	}
	public Button getCadastrarProfissionalBtn() {
		return cadastrarProfissionalBtn;
	}

	public void setCadastrarProfissionalBtn(Button cadastrarProfissionalBtn) {
		this.cadastrarProfissionalBtn = cadastrarProfissionalBtn;
	}

	
}